package com.moku.tester;

import net.rim.device.api.notification.NotificationsConstants;
import net.rim.device.api.notification.NotificationsManager;
import net.rim.device.api.system.EventLogger;
import net.rim.device.api.ui.UiApplication;

public class HttpTester extends UiApplication {

	static final long ID = 0xf06ed20536dfce00L;

	private HttpTesterScreen httpTesterScreen;

	/**
	 * Entry point for application
	 * 
	 * @param args
	 *            Command line arguments (not used)
	 */
	public static void main(String[] args) {
		// Create a new instance of the application.
		EventLogger.register(HttpTester.ID, "HttpTester",
				EventLogger.VIEWER_STRING);

		HttpTester theApp = new HttpTester();

		theApp.registerNotificationObjects();
		// Make the currently running thread the application's event
		// dispatch thread and begin processing events.
		theApp.enterEventDispatcher();

	}

	public HttpTester() {
		httpTesterScreen = new HttpTesterScreen();
		pushScreen(httpTesterScreen);

	}

	public HttpTesterScreen getHttpTesterScreen() {
		return httpTesterScreen;
	}

	private void registerNotificationObjects() {
		// A source is registered to tell the system that our application will
		// be sending notification events. This will will cause a new user
		// editable configuration to be added to the Profiles application.
		NotificationsManager.registerSource(ID, new Object() {
			public String toString() {
				return "HttpTester";
			}
		}, NotificationsConstants.IMPORTANT);

		// Our Consequence implementation will invoked whenever an immediate
		// event occurs.
		NotificationsManager.registerConsequence(ConsequenceImpl.ID,
				new ConsequenceImpl());
	}

}
